浏览量 1868
2022/02/18 01:15
背景
个别用户反馈无法登录
调查
查看日志找到一条错误记录:
java.lang.IllegalArgumentException: Request header is too large
定位原因
一个request中 总的header超过了8kb,其中jwt token就超过了6kb,加上其他杂七杂八的header超过了8kb.
tomcat 8版本 默认不允许超过 8kb
tomcat 5版本 默认不允许超过 4kb
临时解决
在报错的服务上增加配置 application.xml
server:
....
max-http-header-size:16KB
....
最终解决
减少jwt token拼接的无用数据量,减少request header 大小.
Background
Feedback from a few users feedback can not logon
Log Error
java.lang.IllegalArgumentException: Request header is too large
Positioning reason
The JWT token in the header exceeds 6kb, and the total request header exceeds 8kb. The default value allowed in Tomcat embedded in Spring Boot is that the Request header cannot exceed 8kb.
tomcat 8 < 8kb
tomcat 5 < 4kb
Temporary solution
Set max-http-header-size to 16K in the recived service
Final solution
Reduce the amount of useless data for JWT token stitching and reduce the size of request Headers.
上一篇 搜索 下一篇